package br.ufrj.so.c;

import java.util.ArrayList;
import java.util.List;

import br.ufrj.so.PaginatedThread;

public class MainClass {

	public static void main(String[] args) {
		
		List<Thread> list = new ArrayList<Thread>();
		
		// inicializa as threads
		for (int i=0; i<10; i++) {
			list.add(new PaginatedThread("Thread " + i, 50));
		}
		
		// executa cada thread a cada 5 segundos
		for (int i=0; i<10; i++) {
			Thread t = list.get(i);
			t.run();
			try {
				t.sleep(5000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		

	}

}
